﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccessLayer;
using DataAccessLayer.RolesDataSetTableAdapters;
using System.Data;
using System.Collections.Specialized;
using RBS_Tools;

namespace BusinessLayer
{
    public class MemberRoles
    {
        private static tbl_MemberRolesTableAdapter TA_MemebersRoles = new tbl_MemberRolesTableAdapter();        
        private static RolesDataSet.tbl_MemberRolesDataTable DT_MemberRoles;

        public static void AddMemberRoles(Guid MemberID, string[] Role)
        {
            DateTime NOW = DateTime.Now;
            foreach (string role in Role)
            {
                TA_MemebersRoles.Insert(Guid.NewGuid(), MemberID, Roles.GetRoleID(role), NOW, NOW);
            }
        }

        public static void AddMemberRoles(Guid MemberID, Guid RoleID)
        {
            DateTime NOW = DateTime.Now;
            TA_MemebersRoles.Insert(Guid.NewGuid(), MemberID, RoleID, NOW, NOW);
        }

        public static void RemoveRoles(Guid MemberID, Guid RoleID)
        {
            TA_MemebersRoles.RemoveRoles(MemberID, RoleID);
        }
    }
}
